package io.github.coderlaoliu.encrypt;

public class EncryptionStrategyFactory {
    public static EncryptionStrategy createEncryptionStrategy(String algorithm) {
        switch (algorithm) {
            case "AES":
                return new AesEncryptionStrategy();
            case "DES":
                return new DesEncryptionStrategy();
            case "RC4":
                return new Rc4EncryptionStrategy();
            case "Rabbit":
                return new RabbitEncryptionStrategy();
            case "MD5":
                return new Md5EncryptionStrategy();
            case "TripleDES":
                return new TripleDesEncryptionStrategy();
            default:
                throw new IllegalArgumentException("不支持的加密算法");
        }
    }
}
